<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>FCKeditor - Sample</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="robots" content="noindex, nofollow" />
 
</head>
<body>
    <link href="../../../css/common.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/css.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/default.css" rel="stylesheet" type="text/css" />
	
	<link href="../sample.css" rel="stylesheet" type="text/css" />
	
	<script src="http://localhost:11111/js/jQuery.js" type="text/javascript"></script>
 
	<script type="text/javascript" src="../../fckeditor.js"></script>
    
	<script type="text/javascript">
	    function FCKeditor_OnComplete(editorInstance) {
	        ok();

	    }

	    function GetInnerHTML() {
	        var editor = FCKeditorAPI.GetInstance("FCKeditor1");
	        editor.EditorDocument.body.innerHTML = "";

	        // Get the editor instance that we want to interact with.
	        var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');

	        alert(oEditor.EditorDocument.body.innerHTML);
	    }
 
	</script>
    <form   method="post" target="_blank">
   <style>
   #br p{  min-height:20px; height:20px}
   #br dl{ margin-bottom:5px; border-bottom:1px solid #eee; margin-left:5px;}
   #br dl dt.dt1{color:#008040; }
   #br dl dt.dt2{color:#44B8FB; }
   #br dl dd{ margin-left:10px; margin-top:5px;}
   #br dl dd img{ margin:1px;}
  
   </style>
<div id="br" style=" width:800px; height:300px; background:#fafafa">
 
</div>
    <script type="text/javascript">

        var sBasePath = document.location.href.substring(0, document.location.href.lastIndexOf('_samples'));
        alert(sBasePath);
        var oFCKeditor = new FCKeditor('FCKeditor1');
        oFCKeditor.BasePath = sBasePath;
        oFCKeditor.ToolbarSet = 'Chat';
        oFCKeditor.Value = '';
        oFCKeditor.Create();
         
    </script>

    </form>
 <input type="button" id="send" value="s" />
 
 <script>
     var editor = null;
     function ok() {
         $("#send").click(function() {
             var html = editor.EditorDocument.body.innerHTML;
             $("#br").append(String.format("<dl><dt class='dt1'>{1}&nbsp;&nbsp;&nbsp;&nbsp;{2}</dt><dd>{0}</dd></dl>", html, "aoxin", gettime()));
             editor.EditorDocument.body.innerHTML = "";
         });
         var editor = FCKeditorAPI.GetInstance("FCKeditor1");
     }
    function gettime() {
        var today = new Date();
         var h = today.getHours();
         var m = today.getMinutes();
         var s = today.getSeconds();
         return String.format("{0}:{1}:{2}",h,m,s);
    }
 </script>
 
 
 
 
 
 
 
 
 
	<div id="eButtons"  >
    
		<input type="button" value="Get innerHTML" onclick="GetInnerHTML();" />
 
	</div>
</body>
</html>
